package com.other.dispatchEvent;

import android.view.MotionEvent;

public class UtilMotionEvent {
    public static String show(MotionEvent e) {
        return "action=" + getEventString(e) + " x=" + e.getX(e.getPointerCount()-1) + " y=" + e.getY(e.getPointerCount()-1);
    }

    public static String getEventString(MotionEvent event) {

        switch (event.getAction()) {
            case MotionEvent.ACTION_DOWN:
                return "ACTION_DOWN";

            case MotionEvent.ACTION_MOVE:
                return "ACTION_MOVE";

            case MotionEvent.ACTION_UP:
                return "ACTION_UP";
        }
        return "MotionEvent unknow";

    }
}
